package l1j.opqlo.NewSystem.鑑定系統.StstusAdd;

import l1j.opqlo.NewSystem.鑑定系統.IdentifiedModel;
import l1j.server.server.model.L1PcInventory;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.utils.Random;

public class AddFireMr extends IdentifiedModel {

	private static AddFireMr _instance;

	public static AddFireMr get() {
		if (_instance == null) {
			_instance = new AddFireMr();
		}
		return _instance;
	}

	@Override
	public void setStatus(final L1PcInstance pc, final L1ItemInstance item,
			final int min, final int max) {

		final int value;
		if (max > 0) {
			value = Random.nextInt(max - min) + min;
		} else {
			value = 0;
		}

		item.setFireMr(value);

		pc.getInventory().updateItem(item, L1PcInventory.COL_FIREMR);
		pc.getInventory().saveItem(item, L1PcInventory.COL_FIREMR);

	}
}